import type { RouteConfig } from '../../typings/router';
import menuController from '../controllers/menu';

/**
 * 菜单模块路由
 */
const authRoutes: RouteConfig[] = [
    {
        method: 'get',
        name: 'retrieveMenu',
        path: '/menu/retrieve',
        middlewares: [menuController.retrieveAction],
    },
    {
        method: 'post',
        name: 'addMenu',
        path: '/menu/add',
        middlewares: [menuController.addAction],
    },
    {
        method: 'put',
        name: 'updateMenu',
        path: '/menu/update',
        middlewares: [menuController.updateAction],
    },
    {
        method: 'delete',
        name: 'deleteMenu',
        path: '/menu/delete',
        middlewares: [menuController.deleteAction],
    },
    {
        method: 'get',
        name: 'allMenu',
        path: '/menu/all',
        middlewares: [menuController.allAction],
    },
    {
        method: 'get',
        name: 'treeMenu',
        path: '/menu/tree',
        middlewares: [menuController.treeAction],
    },
];

export default authRoutes;
